package com.chaoxing.ai.speechsynthesis.Controller;

import com.chaoxing.ai.speechsynthesis.service.SpeechService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/ai/SpeechSynthesis")
public class SpeechSynthesisController {
    @Resource
    private SpeechService speechService;


    /**
     * 语音合成
     * @param  words 接收前端传来的字符串转换成音频
     *
     */
    @RequestMapping(
            value="/synthesis",
            method = RequestMethod.POST)
    @CrossOrigin
    public String SpeechSynthesis(@RequestParam("words") String words){
        return speechService.inSpeechRecognition(words);
    }

}
